/*******************************************************************
 *
 * Copyright (C), 2022-2027, YouGan, All rights reserved.
 *
 * Author      : zhaoyang
 * Create Time : 2022-10-15
 * Version     : v0.1
 * Description : 
 *******************************************************************/
#ifndef _GPIO_I2C_H__
#define _GPIO_I2C_H__

/*----------------------------Head file----------------------------*/
#include "stdint.h"

/*----------------------------type define--------------------------*/

typedef struct
{
    uint8_t        SDA_Pin;                //SDA脚Pin
    uint8_t        SCL_Pin;                //SCL脚Pin
} sw_i2c_gpio_t;

/*--------------------------var declarative------------------------*/

/*-------------------------func declaration------------------------*/


/*----------------------------macro file---------------------------*/

/*-----------------------------------------------------------------*/

extern void sw_i2c_init(sw_i2c_gpio_t* gpio);
extern uint8_t sw_i2c_send2read_8bit(sw_i2c_gpio_t* gpio, uint8_t i2c_addr,uint8_t reg,uint8_t *buf,uint8_t len);

extern uint8_t sw_i2c_write_nBytes(sw_i2c_gpio_t* gpio, uint8_t i2c_addr,uint8_t *data,uint8_t len);

#endif // _GPIO_I2C_H__

